package com.ruoyi.common.sql;

import java.util.Arrays;
import java.util.List;

public class GroupBy{
    private final List<String> columns;

    private GroupBy(List<String> columns) {
        this.columns = columns;
    }

    public static GroupBy of(String... columns) {
        return new GroupBy(Arrays.asList(columns));
    }

    public void build(StringBuilder sql) {
        sql.append(" GROUP BY ").append(String.join(", ", columns));
    }
}

